package cn.tedu.shoot;

import java.awt.image.BufferedImage;

/**
 * @author JokerQiu
 * @desc
 * @date 2021/12/05
 */
public class Airplane extends FlyingObject{
    private int step; //移动速度

    /** 构造方法 */
    public Airplane(){
        width = 48;
        height = 50;
        x = (int)(Math.random()*(Start.WIDTH-this.width)+1);
        System.out.println(x);
        y = -this.height;
//        y = this.height;
        step = 2;
    }
    @Override
    public void step() {
        y+=step;
    }

    @Override
    public BufferedImage getImage() {
        return Images.airplanes[0];
    }

    @Override
    public boolean outOfBounds() {
        return this.y>=Start.HEIGHT;
    }
}
